﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using UniRlv.UI.Main.Widget;

namespace UniRlv.UI.Main
{
    public partial class FrmFirstPage : UniRlv.UI.Main.FrmBase
    {
        FrmExpDeal frmCurExp;
        public FrmFirstPage()
        {
            InitializeComponent();
        }

        private void FrmFirstPage_Load(object sender, EventArgs e)
        {
            toolStrip1.Visible = false;
            toolBtnAdd.Visible = true;
            ToolStripButton tbb = AddToolButton("test", "测试");
            tbb.Click += Tbb_Click;
        }

        private void Tbb_Click(object sender, EventArgs e)
        {
            FrmExpDeal frmExp;

            frmExp = new FrmExpDeal();
            frmCurExp = frmExp;

            frmExp.Tip = "测试输入数据";
            if (frmExp.ShowDialog(this) == DialogResult.OK)
            {
                string s = "";

                foreach (var item in frmExp.Codes)
                {
                    s += item;
                    s += ", ";
                }

                MessageBox.Show(s);
            }
        }

        public override void OnScanCode(string orgCode, string validCode)
        {
            if (frmCurExp != null)
            {
                frmCurExp.AddCode(orgCode);
            }
        }
    }
}
